# Changes:
# Added ignore list
# Forgot to dump the triggers in file. Fixed now

import cPickle

# settings
try:
    file = open('settings.cfg','r')
    file.close()
    
    print 'Settings file already exists. Please delete it before running this script.'

except:
    file = open('settings.cfg','w')
    settings = {}
    settings['network'] = '' 
    settings['port'] = 6667
    settings['channel'] = '#' 
    settings['botowner'] = '' # one man to rule them all
    settings['botnick'] = 'keebot' 
    settings['quit_msg'] = 'You don`t even care, do you?' # message sent to the channel before dying
    settings['botmods'] = [settings['botowner']] # add owner to mods in case of owner change
    settings['nspass'] = '' # NickServ password. Don`t change if you don`t know what that is

    cPickle.dump(settings,file)
    
    file.close()
    
    print 'Settings file created successfully.'

# ignore list

try:
    file = open('ignore.db','r')
    file.close()
    
    print 'Ignore list already exists. Please delete it before running this script.'
    
except:
    
    file = open('ignore.db','w')
    ignore = []
    cPickle.dump(ignore,file)
    file.close()
    
    print 'Ignore list created successfully.'


# triggers
try:
    file = open('data.db','r')
    file.close()
    
    print 'Trigger database already exists. Please delete it before running this script.'

except:
    file = open('data.db','w')
    triggers = {'^(hello)$':['Hello there']}
    cPickle.dump(triggers,file)
    file.close()
    
    print 'Trigger database created successfully. .'
